﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="TaskListsPopUp.aspx.cs" Inherits="KPIS.GERP.ESS.APP.App_UI.Forms.TaskListsPopUp" %>

<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="KPIS.GERP" %>
<%@ Import Namespace="KPIS.GERP.ESS.APP.App_UI.Forms" %>
<%@ Import Namespace="KPIS.GERP.ESS.APP.GerpAuthenService" %>
<%@ Register Src="../UserControls/Reply.ascx" TagName="Reply" TagPrefix="uc2" %>
<%@ Register Src="../UserControls/Mail_Request.ascx" TagName="Request" TagPrefix="uc3" %>
<%@ Register Src="../UserControls/AC_ApproveRequest.ascx" TagName="AC_ApproveRequest" TagPrefix="ucAC1" %>
<%@ Register Src="../UserControls/RequestAbsences.ascx" TagName="RequestAbsences" TagPrefix="uc4" %>
<%@ Register Src="../UserControls/MailActivity.ascx" TagName="MailActivity" TagPrefix="uc5" %>
<%@ Register Src="../UserControls/MailRequestTraining.ascx" TagName="MailRequestTraining" TagPrefix="uc6" %>
<%@ Register Src="../UserControls/Mail_BgmProjectOperation.ascx" TagName="Mail_BgmProjectOperation" TagPrefix="uc7" %>
<%@ Register Src="../UserControls/Mail_BgmRequestTemp.ascx" TagName="Mail_BgmRequestTemp" TagPrefix="uc8" %>
<%@ Register Src="../UserControls/Mail_IcmPrePurchaseRequest.ascx" TagName="Mail_IcmPrePurchaseRequest" TagPrefix="uc9" %>
<%@ Register Src="../UserControls/Mail_Petition.ascx" TagName="Mail_Petition" TagPrefix="uc10" %>
<%@ Register Src="../UserControls/Mail_Payment.ascx" TagName="Mail_Payment" TagPrefix="uc11" %>
<%@ Register Src="../UserControls/Mail_BgmProjectOperationEdit.ascx" TagName="Mail_BgmProjectOperationEdit" TagPrefix="uc12" %>
<%@ Register Src="../UserControls/Mail_Return.ascx" TagName="Mail_Return" TagPrefix="uc13" %>
<%@ Register Src="../UserControls/Mail_FimMoneyReturns.ascx" TagName="Mail_FimMoneyReturns" TagPrefix="uc14" %>
<%@ Register Src="~/App_UI/UserControls/TaskMessage.ascx" TagPrefix="uc10" TagName="TaskMessage" %>


<html xmlns="http://www.w3.org/1999/xhtml" style="height: 95%;">
<head id="Head1" runat="server">

    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <title>ข้อความถึงคุณ</title>

    <link href="../Styles/CssClass.css" rel="cssclass" type="text/css" />
    <link href="../Styles/StyleSheet.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Scripts/DatePicker.js"></script>
    <script type="text/javascript" src="../Scripts/Common.js"></script>

    <style type="text/css">
        .auto-style1 {
            height: 50px;
        }

        div.RadGrid .rgPager .rgAdvPart {
            display: none;
        }

        .rgFilterBox {
            height: 24px !important;
        }
    </style>

</head>

<body id="TaskListsPopUpBody" style="height: 95%;">
    <form id="form1" runat="server">
        <%-- style="font-family: Tahoma !important; font-size: small !important;"--%>

        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <asp:ScriptReference Path="~/App_UI/Scripts/jquery-1.9.1.min.js" />
            </Scripts>
        </telerik:RadScriptManager>

        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="PanelControl">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="PanelProgress" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelBody" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelControl" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="PanelProgress">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="PanelProgress" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelBody" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelControl" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="PanelBody">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="PanelProgress" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelBody" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelControl" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" IsSticky="true"
            BackgroundPosition="none" CssClass="LoadingPanel">
            <div>
                <table>
                    <tr>
                        <td style="color: #666666; font-size: medium; font-weight: bold;" align="right" valign="bottom" class="auto-style1">กรุณารอสักครู่...
                        <asp:Image ID="Image1" runat="server" ImageUrl="../Images/PageViews/loading.gif" />
                        </td>
                    </tr>
                </table>
            </div>
        </telerik:RadAjaxLoadingPanel>

        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function confirmMultipleApprove() {
                    var grid = $find('RadGridRequest');
                    var MasterTable = grid.get_masterTableView();
                    //var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
                    var row = MasterTable.get_selectedItems().length;
                    //var cell = MasterTable.getCellByColumnUniqueName(row, "CategoryID");
                    //here cell.innerHTML holds the value of the cell  
                    if (row == 0) {
                        alert("ท่านยังไม่เลือกรายการที่จะอนุมัติ");
                        return false;
                    }
                    return confirm("ท่านต้องการยืนยันการอนุมัติ " + row + " รายการหรือไม่");
                }
                function openApprovePath(send_seq) {
                    var oWnd = radopen("ApprovePath.aspx?send_seq=" + send_seq, "ApprovePath").setSize(600, 400);
                }
                function UpdateItemCountField(sender, args) {
                    //set the footer text
                    sender.get_dropDownElement().lastChild.innerHTML = "ทั้งหมด " + sender.get_items().get_count() + " รายการ";
                }

                var tmrDisableAnchor = setInterval(DisableAnchor, 500);

                function DisableAnchor() {
                    //window.clearInterval(myVar);
                    $('a').each(function () {
                        try {
                            if ($(this).attr('disabled')) {
                                $(this).css("color", "silver");
                                $(this).css("text-shadow", " 0.1em 0.1em #333");
                                $(this).removeAttr('onclick', '');
                            }

                            $(this).click(function (e) {
                                //alert('click');
                                if ($(this).attr('disabled')) {

                                    //alert('disabled');
                                    e.preventDefault();
                                    e.stopImmediatePropagation();
                                } else {
                                    //alert('not disabled');
                                }
                            });
                            var events = $._data ? $._data(this, 'events') : $(this).data('events');
                            events.click.splice(0, 0, events.click.pop());
                        } catch (exception) {
                            //alert('Exception: ' + exception);
                        }
                    });
                }

                function popup3() {
                    <%
                string strServer = HttpContext.Current.Request.Url.Host;
                string strUrlPrefix = string.IsNullOrEmpty(ConfigurationSettings.AppSettings["SubSystem"]) ? "" : "/" + ConfigurationSettings.AppSettings["SubSystem"];

                // ReqestPort = 80 mean production server, not 80 = debuging
                string serverPath = !HttpContext.Current.Request.Url.IsDefaultPort ?
                    "http://localhost:64259" :
                    string.Format("http://{0}{1}/GHRMS", strServer, strUrlPrefix);
                // APP_UI/Forms/SingleSigon.aspx?token=&redirectPage=./PS_EmployeesDtls
                string strTaskUrl = string.Format("/App_UI/Forms/MP_PositionWorkOnDuty.aspx?do=index&emp_seq={0}", KPIS.GERP.SsMng.EmpSeq);
                //var sAuthen = new GerpAuthenService();
                //string tokenKey = sAuthen.CreateOTP(KPIS.GERP.SsMng.EmpSeqI, true, strTaskUrl);
                //string strUrl = string.Format("{0}?token={1}", serverPath, tokenKey);
                string strUrl = serverPath + "/App_UI/Forms/SingleSigon.aspx?redirectPage=" + strTaskUrl.Replace('&', '|');
                    %>

                    ShowEmbededPage('<%= radWindowWorkOnDuty.ClientID %>', "<%=strUrl%>", true);
                }

                function ShowEmbededPage(windowName, address, maximizeWin) {
                    try {
                        //Getting rad window manager 
                        var oManager = GetRadWindowManager();
                        var oWnd = oManager.getWindowByName(windowName);
                        if (oWnd == null) {
                            oManager = GetWindow().GetWindowManager();
                            oWnd = oManager.getWindowByName(windowName);
                        }

                        oWnd.setUrl(address);
                        oWnd.setActive();
                        oWnd.show();
                        if (maximizeWin != null && maximizeWin.toString().toLowerCase() == 'true') {
                            oWnd.maximize();
                        }
                    }
                    catch (e) {
                        alert("Error! " + windowName + ": " + e);
                    }

                    return false;
                }

                function GetWindow() {
                    var oWindow = null;
                    if (window.radWindow) oWindow = window.radWindow;
                    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                    return oWindow;

                }
                
                function RowSelected(sender, eventArgs) {
                    var grid = sender;
                    var count = grid.get_masterTableView().get_selectedItems().length;
                     
                    $('#lblRadgridRequestSelectingCount').html(count > 0 ? 'กำลังเลือก: ' + count + ' รายการ': '');

                }
                 
                function frameTaskHeight() {
                    var a1 = 300;
                    try {
                        var h1 = $("#TaskListsPopUpBody").height();
                        var h2 = $("#rowInbox1").height();
                        a1 = h1 - h2 - 10;
                    } catch (exception1) {
                        alert('exception1:' + exception1);
                    }
                    return a1;
                }
                function createFrame(url) {
                    try {
                        d = document.getElementById("<%=TaskMessage.FrameZoneClientId %>"); //grab div to connect to iframe
                        if(d == null) {return ;}
                        // Interlim resolve problem, if request by https then frame must be https.
                        if (<%= Request.Url.AbsoluteUri.StartsWith("https") ? "true": "false" %> && url.indexOf('http:') == 0) 
                        {
                            url = url.replace("http:", "https:");
                        }
                        
                        if (document.getElementById("extenalLink") !== null) {
                            var d = document.getElementById("<%=TaskMessage.FrameZoneClientId %>");
                            d.removeChild(document.getElementById("extenalLink"));
                        }
                        
                        var iframe = document.createElement("iframe"); //create iframe
                        iframe.id = "extenalLink"; //name
                        iframe.src = url; //"Widget/Twitter/LockBackground.html"; //location
                        iframe.style.backgroundColor = "transparent"; //transbg
                        iframe.frameBorder = "0"; //no border
                        iframe.allowTransparency = "true"; //allow trans
                        iframe.width = '100%';
                         
                        d.appendChild(iframe); //connect
                        iframe = null;
                        d = null; 
                        
                        $('#extenalLink').height(frameTaskHeight() + 'px'); 

                    } catch(e) {
                        alert("Exception e ESS - TaskMessage.ascx - Javascript:createFrame(url):" + i + ', ' + e);
                    }
                }

                function removeIframe() {
                    try {
                        var iframe = document.getElementById("extenalLink");
                        if (iframe != null) {
                            iframe.src = ""; //clear
                            iframe = null; //clear
                            var d = document.getElementById("<%=TaskMessage.FrameZoneClientId %>");
                            d.removeChild(document.getElementById("extenalLink"));
                        }
                    } catch(e) {
                        alert("Exception e removeIframe(ess):" + e);
                    }

                }
            </script>
        </telerik:RadCodeBlock>

        <telerik:RadWindowManager runat="server">
            <Windows>
                <telerik:RadWindow ID="radWindowWorkOnDuty" runat="server" Skin="Outlook" Width="800px" Height="540px"
                    Behaviors="Reload, Close, Maximize,Move,Minimize" VisibleStatusbar="False" />
            </Windows>
        </telerik:RadWindowManager>

        <asp:HiddenField ID="HiddenField1" runat="server" />

        <table width="100%" cellpadding="0" cellspacing="0" class="AllBorder">
            <tr id="rowInbox1">
                <td width="150px" class="PanelPage">
                    <asp:Panel ID="PanelPage" runat="server">
                        <asp:Label ID="lblPage" runat="server" Text="กล่องข้อความ" CssClass="LabelMode" />
                    </asp:Panel>
                </td>
                <td>
                    <asp:Panel ID="PanelControl" runat="server" CssClass="PanelControl">
                        <div class="DivControl">
                            <table cellpadding="0" cellspacing="0" width="100%" border="0">
                                <tr>
                                    <td width="120px" class="controls">
                                        <asp:Label ID="lblMode" runat="server" Visible="false" />
                                        <asp:Label ID="lblModeName" runat="server" CssClass="LabelMode" />&nbsp;
                                    </td>
                                    <td width="350px">
                                        <asp:LinkButton ID="cmdBack" runat="server" CssClass="LinkButtonControlWhite" OnClick="cmdBack_Click">
                                            <img alt="" id="imgBack" runat="server" height="14" src="~/App_UI/Images/Buttons/Back.png" />
                                            กลับ
                                        </asp:LinkButton>
                                        <asp:LinkButton ID="cmdMultiSelectStart" ToolTip="คำสั่งหลายรายการ" runat="server" CssClass="LinkButtonControlWhite" OnCommand="cmd_Command" CommandArgument="StartMultiAction">
                                            <img alt="" id="imgBack0" runat="server" height="18" src="~/App_UI/Images/Buttons/CheckBox.png" />
                                            คำสั่งหลายรายการ
                                        </asp:LinkButton>
                                        <asp:LinkButton ID="cmdMultiSelectStop" ToolTip="ยกเลิกคำสั่งหลายรายการ" runat="server" CssClass="LinkButtonControlWhite" OnCommand="cmd_Command" CommandArgument="StopMultiAction" Visible="False">
                                            <img alt="" id="img3" runat="server" height="18" src="~/App_UI/Images/Buttons/CheckBoxDisable.png" />
                                            เลิกคำสั่งหลายรายการ
                                        </asp:LinkButton>
                                        <table runat="server" id="tbReasons" style="display: inline-block;" visible="False">
                                            <tr valign="bottom">
                                                <td style="color: white">หมายเหตุ</td>
                                                <td>
                                                    <asp:TextBox runat="server" ID="txtRemark" Width="80px"></asp:TextBox></td>
                                            </tr>
                                        </table>
                                        <asp:LinkButton ID="cmdApproveConfirmPopup" runat="server"
                                            CssClass="LinkButtonControlWhite" Visible="False"
                                            OnCommand="cmd_Command" CommandArgument="ApproveConfirmPopup"
                                            OnClientClick="javascript:return confirmMultipleApprove();">
                                            <img alt="" id="img6" runat="server" height="18" src="~/App_UI/Images/Buttons/Update.gif" />
                                            อนุมัติ
                                        </asp:LinkButton>
                                    </td>
                                    <td style="text-align: right;">
                                        <asp:Literal runat="server" ID="ltrWodList"></asp:Literal>&nbsp;
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td width="150px" valign="top">
                    <asp:Panel ID="PanelProgress" runat="server" CssClass="PanelProgress">
                        <div class="DivProgress">
                            <ul class="ProgressList">
                                <li id="li1" runat="server">
                                    <table>
                                        <tr>
                                            <td width="10"></td>
                                            <td>
                                                <asp:LinkButton ID="cmdViewRequest" runat="server" CssClass="LinkButton"
                                                    OnClick="cmdViewRequest_Click" CausesValidation="False">
                                                    <img alt="" id="img5" runat="server" src="~/App_UI/Images/Buttons/email.png" />
                                                    ข้อความถึงคุณ
                                                </asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li id="li2" runat="server">
                                    <table>
                                        <tr>
                                            <td width="10"></td>
                                            <td>
                                                <asp:LinkButton ID="cmdViewReply" runat="server" CssClass="LinkButton"
                                                    OnClick="cmdViewReply_Click" CausesValidation="False">
                                                    <img alt="" id="img2" runat="server" src="~/App_UI/Images/Buttons/ReplyedMail.png" />
                                                    ข้อความที่ตอบกลับ
                                                </asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li id="li3" runat="server">
                                    <table>
                                        <tr>
                                            <td width="10"></td>
                                            <td>
                                                <asp:LinkButton ID="cmdViewSent" runat="server" CssClass="LinkButton"
                                                    OnClick="cmdViewSent_Click" CausesValidation="False">
                                                    <img alt="" id="img1" runat="server" src="~/App_UI/Images/Buttons/email_go.png" />
                                                    ข้อความที่ส่งแล้ว
                                                </asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <hr width="100%">
                                <li id="li4" runat="server">
                                    <table>
                                        <tr>
                                            <td width="10"></td>
                                            <td>เลือกหน่วยงาน
                                            </td>
                                        </tr>
                                    </table>
                                    <table>
                                        <tr>
                                            <td width="10"></td>
                                            <td>
                                                <telerik:RadComboBox ID="ddlFilterJobsiteSeq" runat="server"
                                                    AutoPostBack="true" Filter="Contains" Width="120px" DropDownWidth="300px"
                                                    DataTextField="job_site_name" DataValueField="job_site_seq"
                                                    OnSelectedIndexChanged="ddlFilterJobsiteSeq_SelectedIndexChanged" />
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                                <li id="li5" runat="server">
                                    <table>
                                        <tr>
                                            <td width="10"></td>
                                            <td>เลือกประเภทข้อความ
                                            </td>
                                        </tr>
                                    </table>
                                    <table>
                                        <tr>
                                            <td width="10"></td>
                                            <td>
                                                <telerik:RadComboBox ID="ddlRefType" runat="server"
                                                    AutoPostBack="true" Filter="Contains" Width="120px"
                                                    OnSelectedIndexChanged="ddlRefType_SelectedIndexChanged">
                                                    <Items>
                                                        <telerik:RadComboBoxItem Text="<ทั้งหมด>" Value="" Selected="true" />
                                                        <telerik:RadComboBoxItem Text="คำของบประมาณ" Value="bgm_request" />
                                                        <telerik:RadComboBoxItem Text="คำขออนุมัติดำเนินงาน" Value="bgm_project_operation" />
                                                        <telerik:RadComboBoxItem Text="คำขอเบิก/ยืม" Value="fim_money_requests" />

                                                        <telerik:RadComboBoxItem Text="คำขอลา" Value="sys_task|absence" />

                                                        <telerik:RadComboBoxItem Text="แจ้งความประสงค์" Value="sys_task|ppr" />

                                                        <telerik:RadComboBoxItem Text="ขอซื้อขอจ้าง" Value="sys_task|pr" />

                                                        <telerik:RadComboBoxItem Text="ใบสั่ง" Value="sys_task|po" />
                                                        <telerik:RadComboBoxItem Text="สัญญา" Value="sys_task|po_contact" />

                                                        <telerik:RadComboBoxItem Text="ประกาศ" Value="sys_task|bid" />

                                                        <telerik:RadComboBoxItem Text="ตรวจรับ" Value="sys_task|dn" />

                                                        <telerik:RadComboBoxItem Text="ขอเบิกวัสดุครุภัณฑ์" Value="sys_task|claim" />

                                                    </Items>
                                                </telerik:RadComboBox>
                                            </td>
                                        </tr>
                                    </table>
                                </li>
                            </ul>
                        </div>
                    </asp:Panel>
                </td>
                <td style="vertical-align: top"><%--<telerik:AjaxSetting AjaxControlID="PanelControl">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="PanelBody" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelControl" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="PanelProgress">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="PanelProgress" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelBody" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelControl" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="PanelBody">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="PanelBody" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="PanelControl" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>--%>
                    <asp:Panel ID="PanelBody" runat="server" CssClass="PanelBody" ScrollBars="Auto">
                        <div>
                            <asp:Panel ID="PanelRadGridRequest" runat="server" Width="100%">
                                <table cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td>
                                            <div class="DivInfo">
                                                <table width="100%">
                                                    <tr>
                                                        <td>ข้อความถึงคุณ
                                                        </td>
                                                        <%--<td>
                                                            <asp:LinkButton ID="cmdShowAll" runat="server" CssClass="LinkButton"
                                                                OnClick="cmdShowAll_Click" CausesValidation="False">
                                                                แสดงข้อความทั้งหมด
                                                            </asp:LinkButton>
                                                        </td>--%>
                                                        <td width="200px" align="right">
                                                            <span id="lblRadgridRequestSelectingCount" style="font-weight: bold;"></span>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="RadGridRequest" runat="server"
                                                AllowFilteringByColumn="True" AllowPaging="True" AutoGenerateColumns="False"
                                                Width="99%" CellSpacing="0" GridLines="None" AllowSorting="True"
                                                GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                GroupingSettings-GroupContinuedFormatString=""
                                                GroupingSettings-GroupContinuesFormatString=""
                                                GroupingSettings-GroupSplitFormat=""
                                                ShowStatusBar="True" OnItemCommand="RadGridRequest_ItemCommand">
                                                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1"
                                                    DataKeyNames="send_seq" NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                                                    <CommandItemSettings ExportToPdfText="Export to PDF" />
                                                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                                                    </RowIndicatorColumn>
                                                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                                                    </ExpandCollapseColumn>
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="send_seq" UniqueName="send_seq" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="ref_seq" UniqueName="ref_seq" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="from_emp_seq" UniqueName="from_emp_seq" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="to_emp_seq" UniqueName="to_emp_seq" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="message_status" UniqueName="message_status" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="from_send_seq" UniqueName="from_send_seq" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="approve_path_seq" UniqueName="approve_path_seq" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="ref_type" UniqueName="ref_type" HeaderText="ref_type" AllowFiltering="False" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="app_prc_id" UniqueName="app_prc_id" HeaderText="app_prc_id" AllowFiltering="False" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="app_prc_name" UniqueName="app_prc_name" HeaderText="app_prc_name" AllowFiltering="False" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="app_prc_grp_id" UniqueName="app_prc_grp_id" HeaderText="app_prc_grp_id" AllowFiltering="False" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="app_prc_grp_name" UniqueName="app_prc_grp_name" HeaderText="app_prc_grp_name" AllowFiltering="False" Visible="False">
                                                        </telerik:GridBoundColumn>

                                                        <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="30px" ItemStyle-HorizontalAlign="Center" UniqueName="status">
                                                            <ItemTemplate>
                                                                <asp:Image ID="imgMail" runat="server" ImageUrl='<%# GetStatusPicture(DataBinder.Eval(Container, "DataItem.message_status").ToString()) %>' ToolTip='<%# GetStatusToolTip(DataBinder.Eval(Container, "DataItem.message_status").ToString()) %>' />
                                                            </ItemTemplate>
                                                            <HeaderStyle Width="30px" />
                                                            <ItemStyle HorizontalAlign="Center" />
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridClientSelectColumn UniqueName="action_select" Visible="False">
                                                        </telerik:GridClientSelectColumn>

                                                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="send_date" DataFormatString="{0:d}" FilterControlWidth="100%" HeaderStyle-Width="90px" HeaderText="วันที่" ShowFilterIcon="False" UniqueName="send_date">
                                                            <HeaderStyle Width="90px" />
                                                        </telerik:GridBoundColumn>

                                                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="ref_no" FilterControlWidth="100%" HeaderStyle-Width="100px" HeaderText="เลขที่รายการ" ShowFilterIcon="False" UniqueName="ref_no">
                                                            <HeaderStyle Width="100px" />
                                                        </telerik:GridBoundColumn>

                                                        <telerik:GridTemplateColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="send_text" FilterControlWidth="100%" HeaderText="ข้อความ" ShowFilterIcon="False" UniqueName="send_text">
                                                            <ItemTemplate>
                                                                <asp:Label runat="server" ForeColor="Orange" Text='<%# 
                                                                  DataBinder.Eval(Container, "DataItem.is_work_on_duty").ToString() == "1" 
                                                                      ? "[*ส่งถึง " + DataBinder.Eval(Container, "DataItem.to_user_name") + "]" 
                                                                      : ""
                                                                    %>' />
                                                                <asp:Literal runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.send_text").ToString() %>'></asp:Literal>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>

                                                        <telerik:GridBoundColumn AllowFiltering="false" UniqueName="is_approvable_value" HeaderText="อนุมัติได้_value" Visible="False" DataField="privilege.is_approvable">
                                                        </telerik:GridBoundColumn>

                                                        <telerik:GridBoundColumn AllowFiltering="false" UniqueName="is_work_on_duty" HeaderText="is_work_on_duty" Visible="False" DataField="is_work_on_duty">
                                                        </telerik:GridBoundColumn>

                                                        <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="request_amount" HeaderText="วงเงินที่ขอ" Visible="True" HeaderStyle-Width="70px">
                                                            <ItemTemplate>
                                                                <div style="text-align: right;">
                                                                    <asp:Literal runat="server"
                                                                        Text='<%# DataBinder.Eval(Container.DataItem, "privilege.request_amount") == null 
                                                                    ?  "-": (DataBinder.Eval(Container,"DataItem.ref_no").ToString().Contains("RP") == true ? "-":(DataBinder.Eval(Container.DataItem, "privilege.request_amount") as decimal? ?? 0).ToString("#,##0.00"))%>' />
                                                                </div>
                                                            </ItemTemplate>
                                                            <HeaderStyle Width="60px" />
                                                        </telerik:GridTemplateColumn>

                                                        <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="max_amount" HeaderText="ท่านอนุมัติได้ไม่เกิน" Visible="false" HeaderStyle-Width="60px">
                                                            <ItemTemplate>
                                                                <div style="text-align: right;">
                                                                    <asp:Literal runat="server"
                                                                        Text='<%# DataBinder.Eval(Container.DataItem, "privilege.max_amount") == null ||
                                                                                 (DataBinder.Eval(Container.DataItem, "privilege.max_amount") as decimal?) == 0
                                                                        ?  "ไม่กำหนด": "ไม่เกิน " + 
                                                                        DataBinder.Eval(Container.DataItem, "privilege.max_amount") %>' />
                                                                </div>
                                                            </ItemTemplate>
                                                            <HeaderStyle Width="60px" />
                                                        </telerik:GridTemplateColumn>

                                                        <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="is_approvable" HeaderText="อนุมัติได้" Visible="False" HeaderStyle-Width="60px">
                                                            <ItemTemplate>
                                                                <asp:Literal runat="server"
                                                                    Text='<%# DataBinder.Eval(Container.DataItem, "privilege.is_approvable") as bool? == true ? 
                                                                "<center><span style=\"color:green;\">ใช่</span></center>" : 
                                                                "<center><span style=\"color:silver;text-shadow: rgb(51, 51, 51) 0.1em 0.1em;\">ไม่ใช่</span></center>" %>' />
                                                            </ItemTemplate>
                                                            <HeaderStyle Width="60px" />
                                                        </telerik:GridTemplateColumn>

                                                        <telerik:GridTemplateColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="from_user_name" FilterControlWidth="100%" HeaderStyle-Width="150px" HeaderText="ผู้ส่ง" ItemStyle-ForeColor="Blue" ShowFilterIcon="False" UniqueName="from_user_name">
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="cmdShowApprovePath" runat="server" CssClass="LinkButton" ForeColor="Blue" OnClientClick='<%# "openApprovePath(" + DataBinder.Eval(Container, "DataItem.send_seq").ToString() + ")" %>' Text='<%# DataBinder.Eval(Container, "DataItem.from_user_name") %>' ToolTip="คลิก เพื่อแสดงเส้นทางการอนุมัติ" />
                                                            </ItemTemplate>
                                                            <HeaderStyle Width="150px" />
                                                            <ItemStyle ForeColor="Blue" />
                                                        </telerik:GridTemplateColumn>

                                                        <telerik:GridBoundColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="reply_type_name" FilterControlWidth="100%" HeaderStyle-Width="100px" HeaderText="สถานะตอบกลับ" ShowFilterIcon="False" UniqueName="reply_type_name">
                                                            <HeaderStyle Width="100px" />
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                    <EditFormSettings>
                                                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                                        </EditColumn>
                                                    </EditFormSettings>
                                                    <PagerStyle AlwaysVisible="true" FirstPageToolTip="กลับหน้าแรก"
                                                        LastPageToolTip="ไปหน้าสุดท้าย" Mode="NextPrevNumericAndAdvanced"
                                                        NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป"
                                                        PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ"
                                                        PagerTextFormat="เปลี่ยนหน้า: {4} &amp;nbsp;หน้า &lt;strong&gt;{0}&lt;/strong&gt; จาก &lt;strong&gt;{1}&nbsp;หน้า&lt;/strong&gt;, รายการที่ &lt;strong&gt;{2}&lt;/strong&gt; ถึง &lt;strong&gt;{3}&lt;/strong&gt; จาก &lt;strong&gt;{5}&nbsp;รายการ&lt;/strong&gt;" />
                                                </MasterTableView>
                                                <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                    GroupContinuedFormatString="" GroupContinuesFormatString=""
                                                    GroupSplitFormat="" />
                                                <ClientSettings EnablePostBackOnRowClick="True" EnableRowHoverStyle="True">
                                                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="True" />
                                                    <ClientEvents OnRowSelected="RowSelected"></ClientEvents>
                                                </ClientSettings>
                                                <FilterMenu EnableImageSprites="False" />
                                            </telerik:RadGrid>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel ID="PanelRadGridSent" runat="server" Width="100%">
                                <table cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td>
                                            <div class="DivInfo">
                                                ข้อความที่ส่งแล้ว
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><%--Height='<%# Unit.Pixel(KPIS.GERP.ESS.APP.App_UI.Forms.SsMng.HeightI - 190) %>'--%>
                                            <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="RadGridSent" runat="server"
                                                AllowFilteringByColumn="true" AllowMultiRowEdit="false"
                                                AllowMultiRowSelection="false" AllowPaging="True" AllowSorting="True"
                                                AutoGenerateColumns="false"
                                                GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                GroupingSettings-GroupContinuedFormatString=""
                                                GroupingSettings-GroupContinuesFormatString=""
                                                GroupingSettings-GroupSplitFormat=""
                                                OnItemCommand="RadGridSent_ItemCommand" ShowStatusBar="true"
                                                Width="99%">
                                                <%--Width="830px"  OnItemDataBound="RadGridSent_ItemDataBound"--%>
                                                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1"
                                                    DataKeyNames="send_seq" NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="send_seq" UniqueName="send_seq"
                                                            Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="ref_seq" UniqueName="ref_seq"
                                                            Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="ref_type" UniqueName="ref_type"
                                                            Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="from_emp_seq" UniqueName="from_emp_seq"
                                                            Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="to_emp_seq" UniqueName="to_emp_seq"
                                                            Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="message_status" UniqueName="message_status"
                                                            Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="from_send_seq" UniqueName="from_send_seq"
                                                            Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="approve_path_seq" UniqueName="approve_path_seq"
                                                            Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="from_user_name" UniqueName="from_user_name"
                                                            Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn AllowFiltering="false"
                                                            HeaderStyle-Width="40px" ItemStyle-HorizontalAlign="Center"
                                                            UniqueName="status">
                                                            <FilterTemplate>
                                                            </FilterTemplate>
                                                            <ItemTemplate>
                                                                <asp:Image ID="imgMail" runat="server"
                                                                    ImageUrl='<%# GetStatusPicture(DataBinder.Eval(Container, "DataItem.message_status").ToString()) %>'
                                                                    ToolTip='<%# GetStatusToolTip(DataBinder.Eval(Container, "DataItem.message_status").ToString()) %>' />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn AutoPostBackOnFilter="true"
                                                            HeaderStyle-Width="90px"
                                                            CurrentFilterFunction="Contains" DataField="send_date" DataFormatString="{0:d}"
                                                            FilterControlWidth="100%" HeaderText="วันที่"
                                                            ShowFilterIcon="False" UniqueName="send_date">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn AutoPostBackOnFilter="true"
                                                            HeaderStyle-Width="100px"
                                                            CurrentFilterFunction="Contains" DataField="ref_no" FilterControlWidth="100%"
                                                            HeaderText="เลขที่รายการ" ShowFilterIcon="False"
                                                            UniqueName="ref_no">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn AutoPostBackOnFilter="true"
                                                            CurrentFilterFunction="Contains" DataField="send_text"
                                                            FilterControlWidth="100%" HeaderText="ข้อความ" ShowFilterIcon="False"
                                                            UniqueName="send_text">
                                                        </telerik:GridBoundColumn>
                                                        <%--<telerik:GridBoundColumn AutoPostBackOnFilter="true"
                                                        HeaderStyle-Width="150px"  
                                                        CurrentFilterFunction="Contains" DataField="to_user_name" 
                                                        FilterControlWidth="100%" HeaderText="ผู้รับ" 
                                                        ShowFilterIcon="False" UniqueName="to_user_name">
                                                    </telerik:GridBoundColumn>--%>
                                                        <telerik:GridTemplateColumn DataField="to_user_name" HeaderText="ผู้รับ"
                                                            HeaderStyle-Width="150px"
                                                            UniqueName="to_user_name" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                            CurrentFilterFunction="Contains" ShowFilterIcon="False">
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="cmdShowApprovePath" runat="server" CssClass="LinkButton"
                                                                    ToolTip="คลิก เพื่อแสดงเส้นทางการอนุมัติ"
                                                                    Text='<%# DataBinder.Eval(Container, "DataItem.to_user_name") %>'
                                                                    OnClientClick='<%# "openApprovePath(" + DataBinder.Eval(Container, "DataItem.send_seq").ToString() + ")" %>' />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn AutoPostBackOnFilter="true"
                                                            HeaderStyle-Width="100px"
                                                            CurrentFilterFunction="Contains" DataField="reply_type_name"
                                                            FilterControlWidth="100%" HeaderText="สถานะตอบกลับ"
                                                            ShowFilterIcon="False" UniqueName="reply_type_name">
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                    <PagerStyle AlwaysVisible="true" FirstPageToolTip="กลับหน้าแรก"
                                                        LastPageToolTip="ไปหน้าสุดท้าย" Mode="NextPrevNumericAndAdvanced" PageSizes="10;20;50;100;250;1000"
                                                        NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" PageSizeLabelText="จำนวนรายการต่อหน้า: "
                                                        PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ"
                                                        PagerTextFormat="เปลี่ยนหน้า: {4} &amp;nbsp;หน้า &lt;strong&gt;{0}&lt;/strong&gt; จาก &lt;strong&gt;{1}&nbsp;หน้า&lt;/strong&gt;, รายการที่ &lt;strong&gt;{2}&lt;/strong&gt; ถึง &lt;strong&gt;{3}&lt;/strong&gt; จาก &lt;strong&gt;{5}&nbsp;รายการ&lt;/strong&gt;" />
                                                </MasterTableView>
                                                <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                    GroupContinuedFormatString="" GroupContinuesFormatString=""
                                                    GroupSplitFormat="" />
                                                <ClientSettings EnablePostBackOnRowClick="true" EnableRowHoverStyle="True">
                                                    <Selecting AllowRowSelect="True" />
                                                    <%--<Scrolling AllowScroll="true" UseStaticHeaders="true" />--%>
                                                </ClientSettings>
                                            </telerik:RadGrid>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel ID="PanelRequest" runat="server">
                                <uc3:Request ID="Request1" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelACRequest" runat="server">
                                <ucAC1:AC_ApproveRequest ID="AC_ApproveRequest" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelRequestAbsence" runat="server">
                                <uc4:RequestAbsences ID="RequestAbsence1" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelRequestTraining" runat="server" Visible="false">
                                <uc6:MailRequestTraining ID="MailRequestTraining1" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelMailActivity" runat="server">
                                <uc5:MailActivity ID="MailActivity1" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelBgmRequest" runat="server">
                                <uc8:Mail_BgmRequestTemp ID="Mail_BgmRequestTemp1" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelBgmProjectOperation" runat="server">
                                <uc7:Mail_BgmProjectOperation ID="Mail_BgmProjectOperation1" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelIcmPrePurchaseRequest" runat="server">
                                <uc9:Mail_IcmPrePurchaseRequest ID="Mail_IcmPrePurchaseRequest1" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelPetitions" runat="server">
                                <uc10:Mail_Petition ID="Mail_Petition1" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelPayments" runat="server">
                                <uc11:Mail_Payment ID="Mail_Payment1" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelBgmProjectOperationEdit" runat="server" Visible="False">
                                <uc12:Mail_BgmProjectOperationEdit ID="Mail_BgmProjectOperationEdit1" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelReturn" runat="server" Visible="False">
                                <uc13:Mail_Return ID="Mail_Return1" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelFimMoneyReturns" runat="server" Visible="False">
                                <uc14:Mail_FimMoneyReturns ID="Mail_FimMoneyReturns1" runat="server" />
                            </asp:Panel>
                            <asp:Panel ID="PanelTask" runat="server">
                                <uc10:TaskMessage runat="server" ID="TaskMessage" />
                            </asp:Panel>

                            <asp:Panel ID="PanelRadGridReply" runat="server" Width="100%">
                                <table cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td>
                                            <div class="DivInfo">
                                                ข้อความที่ตอบกลับ
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td><%--Height='<%# Unit.Pixel(KPIS.GERP.ESS.APP.App_UI.Forms.SsMng.HeightI - 290) %>'--%>
                                            <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="RadGridReply" runat="server" AutoGenerateColumns="false"
                                                AllowMultiRowEdit="false" AllowMultiRowSelection="false"
                                                ShowStatusBar="true" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="true"
                                                Width="99%"
                                                GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                GroupingSettings-GroupContinuedFormatString=""
                                                GroupingSettings-GroupContinuesFormatString=""
                                                GroupingSettings-GroupSplitFormat=""
                                                OnItemCommand="RadGridReply_ItemCommand">
                                                <%--OnItemDataBound="RadGridReply_ItemDataBound"--%>
                                                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1"
                                                    DataKeyNames="reply_seq" NoMasterRecordsText="< ไม่มีข้อมูล >">
                                                    <RowIndicatorColumn>
                                                        <HeaderStyle Width="20px" />
                                                    </RowIndicatorColumn>
                                                    <ExpandCollapseColumn>
                                                        <HeaderStyle Width="20px" />
                                                    </ExpandCollapseColumn>
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="reply_seq" DataType="System.Int32"
                                                            Display="False" HeaderText="reply_seq" ReadOnly="True"
                                                            UniqueName="reply_seq" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="from_emp_seq"
                                                            UniqueName="from_emp_seq" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="to_emp_seq"
                                                            UniqueName="to_emp_seq" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="message_status"
                                                            UniqueName="message_status" Visible="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="from_send_seq"
                                                            UniqueName="from_send_seq" Visible="False">
                                                        </telerik:GridBoundColumn>

                                                        <telerik:GridTemplateColumn UniqueName="status" HeaderStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                                                            <FilterTemplate>
                                                            </FilterTemplate>
                                                            <ItemTemplate>
                                                                <asp:Image ID="imgMail" runat="server"
                                                                    ImageUrl='<%# GetStatusPicture(DataBinder.Eval(Container, "DataItem.message_status").ToString()) %>'
                                                                    ToolTip='<%# GetStatusToolTip(DataBinder.Eval(Container, "DataItem.message_status").ToString()) %>' />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn DataField="reply_date" HeaderText="วันที่"
                                                            HeaderStyle-Width="100px"
                                                            UniqueName="reply_date" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                            CurrentFilterFunction="Contains" ShowFilterIcon="False"
                                                            DataFormatString="{0:d}">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="ref_no" HeaderText="เลขที่รายการ"
                                                            HeaderStyle-Width="110px"
                                                            UniqueName="ref_no" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                            CurrentFilterFunction="Contains" ShowFilterIcon="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="reply_text" HeaderText="ข้อความ"
                                                            UniqueName="reply_text" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                            CurrentFilterFunction="Contains" ShowFilterIcon="False">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn DataField="from_user_name" HeaderText="ผู้ส่ง"
                                                            HeaderStyle-Width="250px"
                                                            UniqueName="from_user_name" FilterControlWidth="100%" AutoPostBackOnFilter="true"
                                                            CurrentFilterFunction="Contains" ShowFilterIcon="False">
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="cmdShowApprovePath" runat="server" CssClass="LinkButton"
                                                                    ToolTip="คลิก เพื่อแสดงเส้นทางการอนุมัติ"
                                                                    Text='<%# DataBinder.Eval(Container, "DataItem.from_user_name") %>'
                                                                    OnClientClick='<%# "openApprovePath(" + DataBinder.Eval(Container, "DataItem.from_send_seq").ToString() + ")" %>' />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                    </Columns>
                                                    <PagerStyle AlwaysVisible="true" FirstPageToolTip="กลับหน้าแรก"
                                                        LastPageToolTip="ไปหน้าสุดท้าย" Mode="NextPrevNumericAndAdvanced" PageSizes="10;20;50;100;250;1000"
                                                        NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" PageSizeLabelText="จำนวนรายการต่อหน้า: "
                                                        PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ"
                                                        PagerTextFormat="เปลี่ยนหน้า: {4} &amp;nbsp;หน้า &lt;strong&gt;{0}&lt;/strong&gt; จาก &lt;strong&gt;{1}&nbsp;หน้า&lt;/strong&gt;, รายการที่ &lt;strong&gt;{2}&lt;/strong&gt; ถึง &lt;strong&gt;{3}&lt;/strong&gt; จาก &lt;strong&gt;{5}&nbsp;รายการ&lt;/strong&gt;" />
                                                </MasterTableView>
                                                <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                                                    GroupContinuedFormatString="" GroupContinuesFormatString=""
                                                    GroupSplitFormat="" />
                                                <ClientSettings EnableRowHoverStyle="True" EnablePostBackOnRowClick="true">
                                                    <Selecting AllowRowSelect="True" />
                                                    <%--<Scrolling AllowScroll="true" UseStaticHeaders="true" />--%>
                                                </ClientSettings>
                                            </telerik:RadGrid>
                                        </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                            <asp:Panel ID="PanelReply" runat="server">
                                <uc2:Reply ID="Reply1" runat="server" />
                            </asp:Panel>
                        </div>

                        <%--<telerik:RadWindow ID="RadWindowRequestApproveConfirm" runat="server" Skin="Telerik" Width="800px" Height="450px" Title="แสดงรายการที่จะอนุมัติ">
                            <ContentTemplate>
                                <telerik:RadGrid ID="RadGridRequestComfirm" runat="server" AllowFilteringByColumn="True" AllowPaging="False" AllowSorting="True" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" GroupingSettings-CaseSensitive="false" GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" GroupingSettings-GroupContinuedFormatString="" GroupingSettings-GroupContinuesFormatString="" GroupingSettings-GroupSplitFormat="" ShowStatusBar="True" Width="99%">
                                    <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" DataKeyNames="send_seq" NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                                        <CommandItemSettings ExportToPdfText="Export to PDF" />
                                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="False">
                                        </RowIndicatorColumn>
                                        <ExpandCollapseColumn Created="True" FilterControlAltText="Filter ExpandColumn column" Visible="True">
                                        </ExpandCollapseColumn>
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="send_seq" UniqueName="send_seq" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="ref_seq" UniqueName="ref_seq" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="from_emp_seq" UniqueName="from_emp_seq" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="to_emp_seq" UniqueName="to_emp_seq" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="message_status" UniqueName="message_status" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="from_send_seq" UniqueName="from_send_seq" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="approve_path_seq" UniqueName="approve_path_seq" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn AllowFiltering="False" DataField="ref_type" HeaderText="ref_type" UniqueName="ref_type" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn AllowFiltering="False" DataField="app_prc_id" HeaderText="app_prc_id" UniqueName="app_prc_id" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn AllowFiltering="False" DataField="app_prc_name" HeaderText="app_prc_name" UniqueName="app_prc_name" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn AllowFiltering="False" DataField="app_prc_grp_id" HeaderText="app_prc_grp_id" UniqueName="app_prc_grp_id" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn AllowFiltering="False" DataField="app_prc_grp_name" HeaderText="app_prc_grp_name" UniqueName="app_prc_grp_name" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="40px" ItemStyle-HorizontalAlign="Center" UniqueName="status">
                                                <ItemTemplate>
                                                    <asp:Image ID="imgMail0" runat="server" ImageUrl='<%# GetStatusPicture(DataBinder.Eval(Container, "DataItem.message_status").ToString()) %>' ToolTip='<%# GetStatusToolTip(DataBinder.Eval(Container, "DataItem.message_status").ToString()) %>' />
                                                </ItemTemplate>
                                                <HeaderStyle Width="40px" />
                                                <ItemStyle HorizontalAlign="Center" />
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridClientSelectColumn UniqueName="action_select" Visible="False">
                                            </telerik:GridClientSelectColumn>
                                            <telerik:GridBoundColumn DataField="is_approvable" HeaderText="อนุมัติได้_value" UniqueName="is_approvable_value" Visible="False">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="60px" HeaderText="อนุมัติได้" UniqueName="is_approvable" Visible="False">
                                                <ItemTemplate>
                                                    <asp:Literal runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "privilege.is_approvable") as bool? == true ? 
                                                                "<center><span style=\"color:green;\">ใช่</span></center>" : 
                                                                "<center><span style=\"color:silver;text-shadow: rgb(51, 51, 51) 0.1em 0.1em;\">ไม่ใช่</span></center>" %>' />
                                                </ItemTemplate>
                                                <HeaderStyle Width="60px" />
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="send_date" DataFormatString="{0:d}" FilterControlWidth="100%" HeaderStyle-Width="90px" HeaderText="วันที่" ShowFilterIcon="False" UniqueName="send_date">
                                                <HeaderStyle Width="90px" />
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="ref_no" FilterControlWidth="100%" HeaderStyle-Width="100px" HeaderText="เลขที่รายการ" ShowFilterIcon="False" UniqueName="ref_no">
                                                <HeaderStyle Width="100px" />
                                            </telerik:GridBoundColumn>
                                            <telerik:GridTemplateColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="send_text" FilterControlWidth="100%" HeaderText="ข้อความ" ShowFilterIcon="False" UniqueName="send_text">
                                                <ItemTemplate>
                                                    <asp:Label runat="server" ForeColor="Orange" Text='<%# 
                                                                  DataBinder.Eval(Container, "DataItem.is_work_on_duty").ToString() == "1" 
                                                                      ? "[*ส่งถึง " + DataBinder.Eval(Container, "DataItem.to_user_name") + "]" 
                                                                      : ""
                                                                    %>' />
                                                    <asp:Literal runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.send_text").ToString() %>'></asp:Literal>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="from_user_name" FilterControlWidth="100%" HeaderStyle-Width="150px" HeaderText="ผู้ส่ง" ShowFilterIcon="False" UniqueName="from_user_name">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" DataField="reply_type_name" FilterControlWidth="100%" HeaderStyle-Width="100px" HeaderText="สถานะตอบกลับ" ShowFilterIcon="False" UniqueName="reply_type_name">
                                                <HeaderStyle Width="100px" />
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                        <EditFormSettings>
                                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                            </EditColumn>
                                        </EditFormSettings>
                                    </MasterTableView>
                                    <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" GroupContinuedFormatString="" GroupContinuesFormatString="" GroupSplitFormat="" />
                                    <ClientSettings EnablePostBackOnRowClick="False" EnableRowHoverStyle="False">
                                        <Selecting AllowRowSelect="False" EnableDragToSelectRows="true" />
                                    </ClientSettings>
                                    <FilterMenu EnableImageSprites="False" />
                                </telerik:RadGrid>
                            </ContentTemplate>
                        </telerik:RadWindow>--%>
                    </asp:Panel>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
<!-- -->
